package decorationPrice.strategy;

import decorationPrice.abs.Fruit;

import java.util.List;

public class FullReductionStrategy implements PromotionStrategy {
    private double fullAmount;   // 满足金额
    private double reduction;    // 减免金额

    public FullReductionStrategy(double fullAmount, double reduction) {
        this.fullAmount = fullAmount;
        this.reduction = reduction;
    }

    @Override
    public double apply(double originalPrice, List<Fruit> fruits) {
        if (originalPrice >= fullAmount) {
            return originalPrice - reduction;
        }
        return originalPrice;
    }
}